<template>
	<view>
		<view class="advertise">
			<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" easing-function="easeOutCubic" :circular="true">
				<swiper-item v-for="(item,index) in advers" :key="index">
					<image :src="item.img" mode="" @click="nav(item.path,item.id)"></image>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	export default{
		props:[
			'advers'
		],
		methods:{
			nav(path,index){
				console.log(path,index)
				uni.navigateTo({
					url:`../../pagesB/Adver_page/Adver_page?id=${index}`
				})
			}
		},
		beforeCreate() {
			console.log('什么时候调用啊')
		}
	}
</script>

<style lang="scss">
	.advertise {
		width: 750rpx;
		height: 155px;

		swiper-item {
			image {
				width: 100%;
				height: 100%;
			}
		}
	}
</style>
